#pragma once

using namespace System;
using namespace Librarian::Data;

namespace Librarian
{
	namespace Logics
	{
		public ref class LogicBase
		{
		private:
			static String^ ConnectionString = "Data Source=localhost;Initial Catalog=librarian;Integrated Security=True";
			IDataProvider^ _provider;
		public:
			property IDataProvider^ Provider
			{
				IDataProvider^ get()
				{
					if (_provider == nullptr)
					{
						_provider = gcnew SqlDataProvider();
						_provider->ConnectionString  = ConnectionString;
					}
					return _provider;
				}
			}
		};
	}
}